﻿using System;
using System.Collections.Generic;
using System.Text;

//CID 0766 //2011.01.23 //Begin
namespace InfoJetSoft.Service.XPath.Exprs
{
    public class NumberExpr : IExpr
    {
        private string _number = null;
        private double _value;

        public NumberExpr(string number)
        {
            this._number = number;
            this._value = double.Parse(this._number);
        }

        public string Number
        {
            get
            {
                return this._number;
            }
        }

        public object Evaluate(ExprContext context)
        {
            return this._value;
        }

        //CID 0866 //2011.04.01 //Begin
        public void Visit(IExprVisitor visitor)
        {
        }
        //CID 0866 //2011.04.01 //End

        public void Print(StringBuilder buffer)
        {
            buffer.Append(this._number);
        }
    }
}
//CID 0766 //2011.01.23 //End